#include "utils.h"

void initArray(int* array, int size, int initValue)
{
  assert(array != NULL);
  int i;
  for (i=0;i<size;i++)
    array[i] = initValue;
}

void cutString(char* strSource, char* strDest, char * end)
{
  assert(strSource != NULL);
  assert(strDest != NULL);
  assert(end != NULL);
  int i = 0;
  while(strSource+i != end)
    {
      strDest[i] = strSource[i];
      i++;
    }
  strDest[i] = strSource[i];
}

void cleanBuffer(char* buffer, int size)
{
  assert(buffer != NULL);
  int i;
  for (i=0; i<size; buffer[i++] = ' ');
  buffer[0] = '\0';
}
